import request from '@/utils/request'
// 获取分类列表
export const getcategories = (params) => request({
  url: '/categories',
  params
})
// 获取分类数量
export const getcount = (params) => request({
  url: '/categories/count',
  params
})
// 获取指定分类
export const getcategory = (id) => request({
  url: '/categories/' + id
})
// 新建分类
export const addcategory = (data) => request({
  url: '/categories',
  method: 'post',
  data
})
// 编辑分类
export const updatacategory = data => request({
  url: '/categories/' + data.id,
  method: 'put',
  data
})
// 删除分类
export const deletecategory = id => request({
  method: 'delete',
  url: '/categories/' + id
})
